package usecasesimpl;

import java.util.List;

import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.ejb.Stateful;
import javax.ejb.Stateless;

import usecases.GestionIngredient;
import dao.IngredientDao;
import domaine.Ingredient;
@Stateless
public class GestionIngredientImpl implements GestionIngredient{

	@EJB
	
	private IngredientDao ingredientDao;
	
	@PostConstruct
	private void sauverIngredients(){
		
			ingredientDao.enregistrer(new Ingredient(1, "Basilique"));
			ingredientDao.enregistrer(new Ingredient(2, "Fromage"));
			ingredientDao.enregistrer(new Ingredient(3, "Tomate"));
			ingredientDao.enregistrer(new Ingredient(4, "Poivre vert"));
			ingredientDao.enregistrer(new Ingredient(5, "Ail"));
			ingredientDao.enregistrer(new Ingredient(6, "Pepperoni"));
			ingredientDao.enregistrer(new Ingredient(7, "Brocoli"));
			ingredientDao.enregistrer(new Ingredient(8, "Champignon"));
			ingredientDao.enregistrer(new Ingredient(9, "PoivreRouge"));
			ingredientDao.enregistrer(new Ingredient(10, "Ciboulette"));
			ingredientDao.enregistrer(new Ingredient(11, "Oignon"));
			ingredientDao.enregistrer(new Ingredient(12, "Bacon"));
			
	}
	
	
	@Override
	public List<Ingredient> listeIngredients() {
		return ingredientDao.lister();
	}

}
